import proFetch from 'src/hrpub/common/utils/project-fetch';
import { getAppPageConfig } from 'src/hrpub/common/utils/utils';
const { appcode, pagecode } = getAppPageConfig();
const path = '/nccloud/hrtrn/psninfoapprove/';
export default {
	name: 'psninfoApprove',
	data: {
		appcode,
		pagecode,
		pageInfo: {
			pageIndex: 1,
			pageSize: 10,
			total: 1,
			totalPage: 1
		},
		hasData: false,
		approveModalShow: false,
		maxlength: 50,
		showMode: 'list-browse',
		tabIndex: '0',
		hrorgobj: {},
		lang: {},
		searchData: {},
		selectedRowPk: [],
		infochangeDetail: {},
		approveComment: '',
		approveStatus: '0'
	},
	sync: {
		update(state, payload) {
			return {
				...state,
				...payload
			};
		}
	},
	async: {
		/* 获取列表数据 */
		getTableData(dispatch, getState, payload) {
			return proFetch({
				url: `${path}PsninfoApproveQueryAction.do`,
				body: payload.postData
			});
		},
		/* 获取详情页数据 */
		getDetailData(dispatch, getState, payload) {
			return proFetch({
				url: `${path}PsninfoApproveDetailAction.do`,
				body: payload.postData
			});
		},
		/* 审批功能 */
		sendApprove(dispatch, getState, payload) {
			return proFetch({
				url: `${path}PsninfoApproveAction.do`,
				body: payload.postData
			});
		},
		/* 审批功能 */
		delItem(dispatch, getState, payload) {
			return proFetch({
				url: `${path}PsninfoApproveDeleteAction.do`,
				body: payload.postData
			});
		}
	}
};
